package com.snoopy.gas1.mapper;

import com.snoopy.gas1.entity.Register;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface RegisterMapper {

    // 插入register表
    @Insert("INSERT INTO register (" +
            "employee_id, employee_name, position, hire_date, " +
            "password, confirm_password, gender" +
            ") VALUES (" +
            "#{employeeId}, #{employeeName}, #{position}, #{hireDate}, " +
            "#{password}, #{confirmPassword}, #{gender}" +
            ")")
    void insert(Register register);

    // 新增：根据员工姓名查询注册信息
    @Select("SELECT * FROM register WHERE employee_name = #{employeeName}")
    Register findByEmployeeName(String employeeName);
}